package com.cgs.query.demo

import com.cgs.query.handler.UserInfoHolder
import com.sucsoft.kotlin.annotation.AllOpen
import mu.KotlinLogging
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

private val logger = KotlinLogging.logger { }

@AllOpen
@Configuration
open class DemoConfiguration2{

    @Bean
    open fun defaultUserInfoHolder(): UserInfoHolder {
        return object : UserInfoHolder {
            override fun getUserId(): String = "admin2"
        }.apply { logger.info { "生成默认的用户管理,用户id:admin2" } }
    }
}